How do I get rid of all this duplicate code

welcome to shbcf.ru